package com.yuantu.judiciary.model.domain;

import com.yuantu.judiciary.model.BaseDO;
import com.yuantu.judiciary.model.enums.AuthType;
import com.yuantu.judiciary.model.enums.OriginType;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * 授权信息
 *
 * @author syw
 * @since 2023-07-04
 **/
@Data
@Entity
@DynamicUpdate
@Table(name = "auth_info")
public class AuthInfoDO extends BaseDO {

    /**
     * 关联id
     */
    @Comment("关联id")
    private Long relativeId;

    /**
     * 认证类型
     */
    @Comment("认证类型")
    private AuthType type;

    /**
     * 认证凭证
     */
    @Comment("认证凭证")
    private String certifyId;

    /**
     * 认证信息
     */
    @Column(columnDefinition = "text")
    @Comment("认证信息")
    private String content;

    /**
     * 认证结果
     */
    @Column(columnDefinition = "text")
    @Comment("认证结果")
    private String result;

    /**
     * 授权是否通过
     */
    @Column(name = "is_passed")
    @Comment("授权是否通过")
    private Boolean passed;

    /**
     * 过期时间
     */
    @Column(columnDefinition = "datetime")
    @Comment("过期时间")
    private Timestamp expiresTime;

    /**
     * 授权时间
     */
    @Comment("授权时间")
    private Timestamp authorizedTime;

    /**
     * 企业信息结果
     */
    @Column(columnDefinition = "text")
    @Comment("企业信息结果")
    private String orgResult;

    /**
     * 来源
     */
    @Enumerated(EnumType.STRING)
    @Comment("来源")
    private OriginType originType;

}
